|
|
|
|
|
|
|
As you can see, the hardest part to this feature is making sure that the text makes some sense. |
|
|
|
|
|
|
|
|
Whenever you learn about controls, the one thing left out most often is how to combine them to perform a needed function within your application. This section shows you how to create your own file-copy routine and dialog box interface that will allow users of your application to copy a file to another location and filename. At this point, however, you won't be using the CommonDialog control to allow users to select the files themselves; that's covered in Day 2's lesson, The Windows Common Dialog in Use. |
|
|
|
|
|
|
|
|
When most programmers think of copying files within a Visual Basic application, they immediately think of the FileCopy command included in the language. Although FileCopy copies the file properly, there's no way for your application to perform any other tasks while the command is executing. If you want to show your users any type of status information, it would be a before and after status only, not continuous as the command is executed. To create this type of dialog-box interface, you'll combine the following on one form: |
|
|
|
|
|
|
|
|
In addition to these controls, you also have two command buttons on the form to allow users to start the process and close the form. To create this small application, start a new project and name it FILECOPY.VBP. To use the ProgressBar and Animation controls, you must add them to your project toolbox by using the Components dialog box (select the Microsoft Common Control 5.0 and Microsoft Common Control-2 5.0 components). Now, add all five controls to the form, as shown in Figure 1.30. The empty box between the Animation and ProgressBar controls is a Label control. |
|
|
|
|
|